<template>
  <el-card class="box-card">
    <el-row>
      <el-col :span="12" :offset="8">
        <my-date v-on:query="queryData"></my-date>
      </el-col>
    </el-row>
    <el-row>
      <el-col>
        <el-table :data="tableData" stripe style="width: 100%">
          <el-table-column prop="name" label="单位"> </el-table-column>
          <el-table-column prop="date" label="日期"> </el-table-column>
          <el-table-column prop="avg" label="平均准确率"> </el-table-column>
        </el-table>
      </el-col>
    </el-row>
  </el-card>
</template>

<script>
import myDate from "../../myDate.vue";
export default {
  components: {
    myDate,
  },
  data() {
    return {
      activeName: "first",
      queryInfo: {
        start: "",
        end: "",
      },
      // 表格数据
      tableData: [],
    };
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
    },
    async queryData(start, end) {
      this.queryInfo.start = start;
      this.queryInfo.end = end;
      console.log(this.queryInfo.start);
      console.log(this.queryInfo.end);
      const { data: res } = await this.$http.get(
        `/manage1/ddjh/da/vue_ddjh_avg?start=${start}&end=${end}`
      );
      this.tableData = res.data;
      console.log("res@@@", res);
    },
  },
};
</script>

<style>
</style>